<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>padding 百分比 案例</title>
  <style>
      .container {
          background: blue;
          width: 400px;
      }

      .outer {
          background: #ccc;
          width: 50%;
          height: 400px;

          display: flex;
          justify-content: center;
          align-items: center;
      }

      .inner {
          /* 150 200 */
          width: 50%;
          height: 50%;
          background: red;

          /* 15 30 45 60 都是按照父元素的宽度而言的 */
          padding: 5% 10% 15% 20%;
      }
  </style>
</head>
<body>
<div class="container">
  <div class="outer">
    <div class="inner"></div>
  </div>
</div>
</body>
</html>
